package com.efesco.service.zhongheInsure;

import com.bstek.dorado.common.*;
import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.DBStatement;
import com.bstek.dorado.view.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;
import com.efesco.common.Tools;
import com.efesco.system.User;

/**
 * logoutListViewModel
 */
public class logoutListViewModel extends DefaultViewModel {
  public void doUpdateData(ParameterSet parameters)
      throws Exception {
	  DoradoContext context = DoradoContext.getContext();
		User user = (User) context.getAttribute(context.SESSION, "User");
	  Dataset dataset = getDataset("dataset_logout_list");
	  RecordIterator iter = dataset.recordIterator();
	  DBStatement dbs = new DBStatement();
	  while (iter.hasNext()) {
			Record ds = iter.nextRecord();
			if(ds.getBoolean("select")==false)
				continue;
			dbs.setSql("update s_zhonghe_manage set status=5,cancle_memo='"+ds.getValue("CANCLE_MEMO")+"',cancle_man="+user.getUserId()+",cancle_date=to_date('"+Tools.format(ds.getDate("CANCLE_DATE"),"yyyy-MM-dd")+"','yyyy-MM-dd'),pay_end_month='"+ds.getValue("PAY_END_MONTH")+"'  where status=4 and zhonghe_manage_id="+ds.getValue("ZHONGHE_MANAGE_ID"));
			dbs.execute();
	  }
   // super.doUpdateData(parameters);
  }

}
